2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Don't corrupt odd keymaps (#316638, Kean Johnston)
+
+ * gdk/x11/gdkkeys-x11.c (set_symbol): Auxiliary function to
+ handle frobbing keymaps with odd numbers of syms/code.
+
+ * gdk/x11/gdkkeys-x11.c (update_keymaps): Use set_symbol() to
+ frob the keymap.
+
Improve navigation to parent folders. (#318444, Andrei Yurkevich)
* gtk/gtkpathbar.[hc]: Add a child_path argument to
2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Don't corrupt odd keymaps (#316638, Kean Johnston)
+
+ * gdk/x11/gdkkeys-x11.c (set_symbol): Auxiliary function to
+ handle frobbing keymaps with odd numbers of syms/code.
+
+ * gdk/x11/gdkkeys-x11.c (update_keymaps): Use set_symbol() to
+ frob the keymap.
+
Improve navigation to parent folders. (#318444, Andrei Yurkevich)
* gtk/gtkpathbar.[hc]: Add a child_path argument to
gint index;
index = KEYSYM_INDEX(keymap_x11, group, level);
- if (index > keymap_x11->keysyms_per_keycode)
+ if (index >= keymap_x11->keysyms_per_keycode)
return NoSymbol;
return syms[index];
}
+static void
+set_symbol (KeySym *syms,
+ GdkKeymapX11 *keymap_x11,
+ gint group,
+ gint level,
+ KeySym sym)
+{
+ gint index;
+
+ index = KEYSYM_INDEX(keymap_x11, group, level);
+ if (index >= keymap_x11->keysyms_per_keycode)
+ return;
+
+ syms[index] = sym;
+}
+
static void
update_keymaps (GdkKeymapX11 *keymap_x11)
{
for (i = 0 ; i < 2 ; i++)
{
if (get_symbol (syms, keymap_x11, i, 0) == GDK_Tab)
- syms[KEYSYM_INDEX (keymap_x11, i, 1)] = GDK_ISO_Left_Tab;
+ set_symbol (syms, keymap_x11, i, 1, GDK_ISO_Left_Tab);
}
/*
gdk_keyval_convert_case (get_symbol (syms, keymap_x11, 0, 0), &lower, &upper);
if (lower != upper)
{
- syms[KEYSYM_INDEX (keymap_x11, 0, 0)] = lower;
- syms[KEYSYM_INDEX (keymap_x11, 0, 1)] = upper;
+ set_symbol (syms, keymap_x11, 0, 0, lower);
+ set_symbol (syms, keymap_x11, 0, 1, upper);
}
}
/* ---- End stuff GDK adds to the original Xlib version ---- */
- return (syms[col]!=NoSymbol);
+ return (syms[col] != NoSymbol);
}
#endif /* HAVE_XKB */